#!/usr/bin/env python
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 textwidth=79 autoindent

"""
Python source code
Last modified: 16 Jul 2011 - 14:19
Last author: Laban Mwangi

Replace this with a description of the code and
write the code below this text.

"""
import optparse
import unittest
import tests.simpletest
import tests.hcktest
import tests.tmrqueenstest


def load_tests(options):

    """load_tests runs testing for all the modules in the current project"""
    test_suites = [tests.simpletest.Test, tests.hcktest.Test,
                   tests.tmrqueenstest.Test, ]
    suites = map(unittest.TestLoader().loadTestsFromTestCase, test_suites)
    map(unittest.TextTestRunner(verbosity=options.debug).run, suites)

def main():
    """Main function. Called when this file is a shell script"""
    usage = "usage: %prog [options]"
    parser = optparse.OptionParser(usage)

    parser.add_option("-v", "--verbose", dest="debug",
                      default="0", type="int",
                      help="Debug. Higher integers increases verbosity")

    (options, args) = parser.parse_args()
    
    load_tests(options)

if __name__ == '__main__':
    main()

